package test.testcase.dao;

import test.utils.JsonResult;
import test.utils.Mysql;

public class ParamDao {
	
	public static JsonResult addModelParam(String modelid, String stepid, String paramName, String method, String rule) {
		return Mysql.excute("insert into param (modelid,modelstepid,paramname,method,expression) values("+modelid+","+stepid+",'"+paramName+"','"+method+"','"+rule+"')");
	}
	
	public static JsonResult addTestCaseParam(String caseid, String stepid, String paramName, String method, String rule) {
		return Mysql.excute("insert into param (caseid,stepid,paramname,method,expression) values("+caseid+","+stepid+",'"+paramName+"','"+method+"','"+rule+"')");
	}
	
	public static void delParam(String stepid) {
		Mysql.excute("delete from param where modelstepid="+stepid);
	}
	
	public static void delTestStepParam(String stepid) {
		Mysql.excute("delete from param where stepid="+stepid);
	}
	
	public static void delParamByCaseId(String caseid) {
		Mysql.excute("delete from param where caseid="+caseid);
	}

}
